#ifndef									__UDPBROADCASTSOCKET_H__
#define									__UDPBROADCASTSOCKET_H__

#include								<boost/asio.hpp>
#include								"ASocket.h"

class									UdpBroadcastSocket : public ASocket
{
public:
	UdpBroadcastSocket(boost::asio::io_service &);
	virtual ~UdpBroadcastSocket();

private:
	boost::asio::ip::udp::socket		_socket;
	PacketHandler						*_handler;
	boost::asio::ip::udp::endpoint		_broadcast_endpoint;
	boost::asio::deadline_timer			_heartbeat_timer;

private:
	virtual void						_startRead();
	virtual void                        _handle_heartbeat(const boost::system::error_code& ec);


public:
	virtual void						start();
	virtual	void						close();
	boost::asio::ip::udp::socket		&getSocket();
	virtual std::string					getIp() const;

};

#endif // ! __UDPBROADCASTSOCKET_H__